<?php

namespace app\api\controller;

use app\api\service\OrderService;
use app\common\controller\ApiBase;

class Order extends ApiBase
{
    protected $noNeedLogin = [''];
    protected $noNeedRight = ['*'];

    public function detail()
    {
        $this->checkRequestParam(\app\common\validate\Order::class);
        $params = $this->request->param();
        $service = new OrderService();
        $order = $service->detail($params['order_no'], $this->auth->id);
        if (empty($order)) {
            $this->error($service->getMsg());
        }
        $this->success('成功', $order);
    }
}
